﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Regions.ascx.cs" Inherits="controls_admin_Regions" %>
<div id="box-tabs" class="box">
    <asp:Literal ID="ltrScript" runat="server" Text="" />
    <script type="text/javascript">
        $(document).ready(function () {
            $('#box-tabs').tabs({
                show: function () {
                    var newIdx = $('#box-tabs').tabs('option', 'selected');
                    $('#theHiddenTabIndex').val(newIdx);
                },
                selected: previouslySelectedTab
            });
            $('#ctl00_btnSubmit').click(function () {
                $("#frm").validate(
                    $("#ctl00_txtDistrict").rules("remove"),
                    $("#ctl00_txtregions").rules("add", {
                        required: true,
                        messages: {
                            required: "<span class='error'>Trường này cần nhập.</span>"
                        }
                    })
                    );
            });
            $('#ctl00_btnDistrict').click(function () {
                $("#frm").validate(
                    $("#ctl00_txtregions").rules("remove"),
                    $("#ctl00_txtDistrict").rules("add", {
                        required: true,
                        messages: {
                            required: "<span class='error'>Trường này cần nhập.</span>"
                        }
                    })
                    );
            });
        });        
    </script>
    <input type="hidden" value="0" id="theHiddenTabIndex" name="theHiddenTabIndex" />
    <!-- box / title -->
    <div class="title">
        <h5>
            Quản Lý Tỉnh Thành</h5>
        <ul class="links">
            <li><a href="#box-provinces">Tỉnh Thành</a></li>
            <li><a href="#box-address">Địa điểm</a></li>
        </ul>
    </div>
    <div id="divMessage" runat="server" />
    <!-- box / title -->
    <div id="box-provinces">
        <div class="form">
            <div class="fields">
                <div class="field  field-first">
                    <div class="label">
                        <label for="input-small">
                            Tỉnh Thành
                        </label>
                    </div>
                    <div class="input">
                        <asp:DropDownList ID="ddlRegion" AutoPostBack="true" AppendDataBoundItems="true"
                            CssClass="select" runat="server" OnSelectedIndexChanged="lbRegion_SelectedIndexChanged">
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="field">
                    <div class="label">
                        <label for="input-small">
                            Tên tỉnh thành
                        </label>
                    </div>
                    <div class="input">
                        <asp:TextBox runat="server" ID="txtregions" MaxLength="50" CssClass="small" />
                    </div>
                    <asp:Button ID="btnDel" runat="server" CssClass="icon-32-delete" BackColor="Transparent"
                        CausesValidation="false" BorderStyle="None" ToolTip="Xóa" OnClick="btnDel_Click"
                        OnClientClick="return confirm('Bạn có chắc chắn muốn xóa không ?');" />
                </div>
                <div class="buttons">
                    <asp:Button ID="btnSubmit" runat="server" Text="Đồng Ý" OnClick="btnSubmit_Click" />
                </div>
            </div>
        </div>
    </div>
    <div id="box-address">
        <div class="form">
            <div class="fields">
                <div class="field  field-first">
                    <div class="label">
                        <label for="input-small">
                            Chọn tỉnh
                        </label>
                    </div>
                    <div class="input">
                        <asp:DropDownList ID="ddlProvince" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlProvince_SelectedIndexChanged"
                            CssClass="select" />
                    </div>
                </div>
                <div class="field">
                    <div class="label">
                        <label for="input-small">
                            Địa điểm
                        </label>
                    </div>
                    <div class="input">
                        <asp:DropDownList ID="ddlDistrict" runat="server" AppendDataBoundItems="true" AutoPostBack="true"
                            OnSelectedIndexChanged="ddlDistrict_SelectedIndexChanged" CssClass="select" />
                    </div>
                </div>
                <div class="field">
                    <div class="label">
                        <label for="input-small">
                            Tên địa điểm
                        </label>
                    </div>
                    <div class="input">
                        <asp:TextBox runat="server" ID="txtDistrict" MaxLength="50" CssClass="small" />
                    </div>
                    <asp:Button ID="btnDistrictDel" runat="server" CssClass="icon-32-delete" BackColor="Transparent"
                        CausesValidation="false" BorderStyle="None" ToolTip="Xóa" OnClick="btnDistrictDel_Click"
                        OnClientClick="return confirm('Bạn có chắc chắn muốn xóa không ?');" />
                </div>
                <div class="buttons">
                    <asp:Button ID="btnDistrict" runat="server" Text="Đồng Ý" OnClick="btnDistrict_Click" />
                </div>
            </div>
        </div>
    </div>
</div>
